]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
portalHelper: Add extra check for policy decision type
authorMichael Catanzaro <mcatanzaro@redhat.com>
Sun, 27 Jul 2025 15:35:58 +0000 (17:35 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 13 Sep 2025 16:54:47 +0000 (18:54 +0200)
This check will always be true currently, because there are only three
possible types of policy decisions, and both of the others are already
handled above. But if new policy decision types are ever added in the
future, then we probably don't want to execute this code.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3813>
(cherry picked from commit c9a93ec66ee722d58aeb3727eb7d606b3704b79b)

js/portalHelper/main.js

index 9d420138c74e31437ba420b41b80eef455afcc6a..60b419d454d28a2b5b1cdc697a88057df83a4058 100644 (file)
@@ -238,6 +238,9 @@ class PortalWindow extends Gtk.ApplicationWindow {
             return true;
         }
 
+        if (type !== WebKit.PolicyDecisionType.NAVIGATION_ACTION)
+            return false;
+
         const uri = GLib.Uri.parse(request.get_uri(), HTTP_URI_FLAGS);
 
         if (uri.get_host() !== this._uri.get_host() && this._originalUrlWasGnome) {